package com.onec.service.trade.controller;

import com.onec.service.api.dto.response.BaseResponse;
import com.onec.service.api.exception.ExceptionHelper;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;


/**
 * 交易服务出口公共controller
 *
 * @author ONEC
 */
public class BaseTradeController {

    @Autowired
    protected ApplicationContext applicationContext;

    /**
     * 请求公共返回数据：成功
     *
     * @param response String
     * @return
     */
//    BaseResponse responseParam(String response) {
//        return BaseResponse.ok(response);
//    }

    /**
     * 请求公共返回数据：失败
     *
     * @param logger
     * @return
     */
    BaseResponse responseParam(Logger logger, Exception e) {
        return ExceptionHelper.handlerException(logger, e);
    }
}
